#include "FunctionCallMgr.h"

CFunctionCallMgr::CFunctionCallMgr(void)
{
	m_akAllCallInfo.clear();
}

CFunctionCallMgr::~CFunctionCallMgr(void)
{
	for (int i = 0;i < (int)m_akAllCallInfo.size();i++)
	{
		CCall& rkCall = m_akAllCallInfo[i];
		delete rkCall.pkCallInfo;
		rkCall.pkCallInfo = NULL;
	}

	m_akAllCallInfo.clear();
}

void CFunctionCallMgr::Update()
{
	for (int i = 0;i < (int)m_akAllCallInfo.size();)
	{
		CCall& rkCall = m_akAllCallInfo[i];
		if (rkCall.pkCallInfo && rkCall.pkCallInfo->GetObject())
		{
			if (!IsObjectExist((const CGameObject*)(rkCall.pkCallInfo->GetObject())))
			{
				UnReg(rkCall.pkCallInfo->GetObject());
				continue;
			}
		}

		rkCall.Update();
		i++;
	}

	return;
}